Component({
  mixins: [],
  data: {
    animation:'',
		rules:'',
		bg:{
			url:"https://img.alicdn.com/imgextra/i2/4161056916/O1CN01QA9nTy20xZquxioZF_!!4161056916.png",
			width:657,
			height:1023
		},
		mineInfo:{
			avatar:'',
			nickName:''
		},

		shareData:[]
	},
	onInit(){

		this.reqShareFir()
		
		my.authorize({
			scopes: 'scope.userInfo',
			success: () => {
				my.getAuthUserInfo({
					success: (userInfo) => {
						this.setData({
							mineInfo:userInfo
						})
					}
				});
			},
		});

	},
  props: {
		mineEnergy:''
  },
  didMount() {
    this.animation = my.createAnimation();

    this.animation.translate('0%','150%').step()
		this.setData({ animation: this.animation.export() })
		

  },
  didUpdate() {},
  didUnmount() {},
  methods: {

		//获取分享好友列表
		reqShareFir(){
			getApp().cloud.function.invoke('client',{},"beShared").then(res => {
				console.info('获取分享好友列表=====>',res)

				if(res.code != 0){

					my.showToast({
						content:res.msg
					});

					return
				}

				this.setData({
					shareData:res.data
				})
			})
		},

		share(){
			my.showSharePanel()
		},

		backMain(){
			this.$page.backMain()
		},

    closeList(){
      
      this.animation.translate('0%','-150%').step()
      this.setData({ animation: this.animation.export() })

      setTimeout(() => {
        this.$page.setData({
          isShowShare:false
        })
      }, 400);
    }

  },
});